package com.westcom.healthmate.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.westcom.healthmate.po.MiraSleepDataPo;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class MiraSleepDataBean
{
    @JSONField(name = "heart_rate")
    private int heartRate;

    @JSONField(name = "breath_rate")
    private int breathRate;

    @JSONField(name = "gatem")
    private int gatem;

    @JSONField(name = "gateo")
    private int gateo;

    @JSONField(name = "celsius")
    private int celsius =0;

    @JSONField(name = "is_on_bed")
    private int isOnBed;

    @JSONField(name = "is_body_move")
    private int isBodyMoved;

    @JSONField(name = "timestamp")
    private long time;

    @JSONField(name = "sn_pw")
    private long snPw;

    @JSONField(name = "snore_count")
    private long snoreCount;

    @JSONField(name = "snore")
    private long snore;

    public MiraSleepDataBean()
    {}

    public MiraSleepDataBean(MiraSleepDataPo po)
    {
        this.setHeartRate((int) po.getHeartBeatRate());
        this.setGateo((int) po.getOnBedPower());
        this.setGatem(po.getBodyMoveRate());
        this.setBreathRate((int) po.getBreathRate());
        this.setIsBodyMoved(po.getIsBodyMoved());
        this.setIsOnBed(po.getIsOnBed());
        this.setTime(po.getTime());
        this.setSnPw(po.getSoundVal());
        this.setSnore(po.getIsSnore());
        this.setSnoreCount(po.getIsSnore()*8);
    }
}
